const config = {
    student: [{
        label: '数据标识', value: 'id', type: 'char', foreignKey: false
    }, {
        label: '学生编号', value: 'studentId', type: 'char', foreignKey: false
    }, {
        label: '姓名', value: 'name', type: 'varchar', foreignKey: false
    }, {
        label: '学院', value: 'college', type: 'char', foreignKey: true
    }, {
        label: '专业', value: 'major', type: 'char', foreignKey: true
    }, {
        label: '班级', value: 'clazz', type: 'char', foreignKey: true
    }, {
        label: '学分', value: 'credit', type: 'float', foreignKey: false
    }],
    teacher: [{
        label: '数据标识', value: 'id', type: 'char', foreignKey: false
    }, {
        label: '教师编号', value: 'teacherId', type: 'char', foreignKey: false
    }, {
        label: '姓名', value: 'name', type: 'varchar', foreignKey: false
    }, {
        label: '学院', value: 'college', type: 'char', foreignKey: true
    }, {
        label: '专业', value: 'major', type: 'char', foreignKey: true
    }, {
        label: '班级', value: 'clazz', type: 'char', foreignKey: true
    }],
    college: [{
        label: '数据标识', value: 'id', type: 'char', foreignKey: false
    }, {
        label: '学院编号', value: 'collegeId', type: 'char', foreignKey: false
    }, {
        label: '学院名称', value: 'name', type: 'varchar', foreignKey: false
    }, {
        label: '主要负责人', value: 'mainInCharge', type: 'char', foreignKey: true
    }],
    major: [{
        label: '数据标识', value: 'id', type: 'char', foreignKey: false
    }, {
        label: '专业编号', value: 'majorId', type: 'char', foreignKey: false
    }, {
        label: '专业名称', value: 'name', type: 'varchar', foreignKey: false
    }, {
        label: '主要负责人', value: 'mainInCharge', type: 'char', foreignKey: true
    }, {
        label: '学院', value: 'college', type: 'char', foreignKey: true
    }],
    clazz: [{
        label: '数据标识', value: 'id', type: 'char', foreignKey: false
    }, {
        label: '班级编号', value: 'clazzId', type: 'char', foreignKey: false
    }, {
        label: '班级名称', value: 'name', type: 'varchar', foreignKey: false
    }, {
        label: '主要负责人', value: 'mainInCharge', type: 'char', foreignKey: true
    }, {
        label: '学院', value: 'college', type: 'char', foreignKey: true
    }, {
        label: '专业', value: 'major', type: 'char', foreignKey: true
    }],
    course: [{
        label: '数据标识', value: 'id', type: 'char', foreignKey: false
    }, {
        label: '课程编号', value: 'courseId', type: 'char', foreignKey: false
    }, {
        label: '课程名称', value: 'name', type: 'varchar', foreignKey: false
    }, {
        label: '教师', value: 'teacher', type: 'char', foreignKey: true
    }, {
        label: '学分', value: 'credit', type: 'float', foreignKey: false
    }],
    score: [{
        label: '数据标识', value: 'id', type: 'char', foreignKey: false
    }, {
        label: '学生', value: 'student', type: 'char', foreignKey: true
    }, {
        label: '课程', value: 'course', type: 'char', foreignKey: true
    }, {
        label: '成绩', value: 'score', type: 'float', foreignKey: false
    }]
};

const formConfig = {
    student: {
        add: {
            form: {
                studentId: null,
                name: null,
                college: null,
                major: null,
                clazz: null,
                credit: null
            },
            rules: {
                studentId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{12}$/,
                    message: '请输入正确格式的学号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                college: [],
                clazz: [],
                credit: []
            }
        },
        edit: {
            id: null,
            dialogFormVisible: false,
            form: {
                studentId: null,
                name: null,
                college: null,
                major: null,
                clazz: null,
                credit: null
            },
            rules: {
                studentId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{12}$/,
                    message: '请输入正确格式的学号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                college: [],
                major: [],
                clazz: [],
                credit: []
            }
        }
    },
    teacher: {
        add: {
            form: {
                teacherId: null,
                name: null,
                college: null,
                major: null,
                clazz: null
            },
            rules: {
                teacherId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{12}$/,
                    message: '请输入正确格式的教师编号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                college: [],
                major: [],
                clazz: []
            }
        },
        edit: {
            id: null,
            dialogFormVisible: false,
            form: {
                teacherId: null,
                name: null,
                college: null,
                major: null,
                clazz: null
            },
            rules: {
                teacherId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{12}$/,
                    message: '请输入正确格式的教师编号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                college: [],
                major: [],
                clazz: []
            }
        }
    },
    college: {
        add: {
            form: {
                collegeId: null,
                name: null,
                mainInCharge: null
            },
            rules: {
                collegeId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{4}$/,
                    message: '请输入正确格式的学院编号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                mainInCharge: []
            }
        },
        edit: {
            id: null,
            dialogFormVisible: false,
            form: {
                collegeId: null,
                name: null,
                mainInCharge: null
            },
            rules: {
                collegeId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{4}$/,
                    message: '请输入正确格式的学院编号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                mainInCharge: []
            }
        }
    },
    major: {
        add: {
            form: {
                majorId: null,
                name: null,
                mainInCharge: null,
                college: null
            },
            rules: {
                majorId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{4}$/,
                    message: '请输入正确格式的专业编号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                mainInCharge: [],
                college: []
            }
        },
        edit: {
            id: null,
            dialogFormVisible: false,
            form: {
                majorId: null,
                name: null,
                mainInCharge: null,
                college: null
            },
            rules: {
                majorId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{4}$/,
                    message: '请输入正确格式的专业编号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                mainInCharge: [],
                college: []
            }
        }
    },
    clazz: {
        add: {
            form: {
                clazzId: null,
                name: null,
                mainInCharge: null,
                college: null,
                major: null
            },
            rules: {
                clazzId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{4}$/,
                    message: '请输入正确格式的班级编号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                mainInCharge: [],
                college: [],
                major: []
            }
        },
        edit: {
            id: null,
            dialogFormVisible: false,
            form: {
                clazzId: null,
                name: null,
                mainInCharge: null,
                college: null,
                major: null
            },
            rules: {
                clazzId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{4}$/,
                    message: '请输入正确格式的班级编号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                mainInCharge: [],
                college: [],
                major: []
            }
        }
    },
    course: {
        add: {
            form: {
                courseId: null,
                name: null,
                teacher: null,
                credit: null
            },
            rules: {
                courseId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{4}$/,
                    message: '请输入正确格式的课程编号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                teacher: [],
                credit: []
            }
        },
        edit: {
            id: null,
            dialogFormVisible: false,
            form: {
                courseId: null,
                name: null,
                teacher: null,
                credit: null
            },
            rules: {
                courseId: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }, {
                    pattern: /^[0-9]{4}$/,
                    message: '请输入正确格式的课程编号',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                teacher: [],
                credit: []
            }
        }
    },
    score: {
        add: {
            form: {
                student: null,
                course: null,
                score: null
            },
            rules: {
                student: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                course: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                score: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }]
            }
        },
        edit: {
            id: null,
            dialogFormVisible: false,
            form: {
                student: null,
                course: null,
                score: null
            },
            rules: {
                student: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                course: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }],
                score: [{
                    required: true,
                    message: '该项为必填项',
                    trigger: 'blur'
                }]
            }
        }
    }
}